home *** CD-ROM | disk | FTP | other *** search
/ MacAddict 104 / MacAddict_104_2005-04.iso / Software / Internet & Communication / WordPress 1.2.2 freeware.dmg / wordpress / wp-admin / menu.php < prev    next >
Encoding:
PHP Script  |  2004-05-11  |  1.8 KB  |  45 lines

  1.  
  2. <ul id="adminmenu">
  3. <?php
  4. // This array constructs the admin menu bar.
  5. //
  6. // Menu item name
  7. // The minimum level the user needs to access the item: between 0 and 10
  8. // The URL of the item's file
  9. $menu = array(
  10.               array(__('Write'), 1, 'post.php'),
  11.               array(__('Edit'), 1, 'edit.php'),
  12.               array(__('Categories'), 3, 'categories.php'),
  13.               array(__('Links'), 5, 'link-manager.php'),
  14.               array(__('Users'), 3, 'users.php'),
  15.               array(__('Options'), 6, 'options-general.php'),
  16.               array(__('Plugins'), 8, 'plugins.php'),
  17.               array(__('Templates'), 4, 'templates.php'),
  18.               array(__('Upload'), get_settings('fileupload_minlevel'), 'upload.php'),
  19.               array(__('Profile'), 0, 'profile.php')
  20. );
  21.  
  22. $self = preg_replace('|.*/wp-admin/|i', '', $_SERVER['PHP_SELF']);
  23. if (!isset($parent_file)) $parent_file = '';
  24. foreach ($menu as $item) {
  25.     $class = '';
  26.  
  27.     // 0 = name, 1 = user_level, 2 = file
  28.     if ((substr($self, -10) == substr($item[2], -10) && empty($parent_file)) || ($parent_file && ($item[2] == $parent_file))) $class = ' class="current"';
  29.     
  30.     if ($user_level >= $item[1]) {
  31.         if (
  32. ('upload.php' == $item[2] && 
  33. get_settings('use_fileupload') && 
  34. ($user_level >= get_settings('fileupload_minlevel'))
  35.              ) || 'upload.php' != $item[2])
  36.             echo "\n\t<li><a href='{$item[2]}'$class>{$item[0]}</a></li>";
  37.     }
  38. }
  39.  
  40. ?>
  41.     <li><a href="<?php echo get_settings('home') . '/' . get_settings('blogfilename'); ?>" title="<?php _e('View your site') ?>"><?php _e('View site') ?> »</a></li>
  42.     <li class="last"><a href="<?php echo get_settings('siteurl')
  43.      ?>/wp-login.php?action=logout" title="<?php _e('Log out of this account') ?>"><?php printf(__('Logout (%s)'), stripslashes($user_nickname)) ?></a></li>
  44. </ul>
  45.